package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MyWorkshopMapper;
import com.ruoyi.system.domain.MyWorkshop;
import com.ruoyi.system.service.IMyWorkshopService;

/**
 * 车间管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-15
 */
@Service
public class MyWorkshopServiceImpl implements IMyWorkshopService 
{
    @Autowired
    private MyWorkshopMapper myWorkshopMapper;

    /**
     * 查询车间管理
     * 
     * @param workshopId 车间管理主键
     * @return 车间管理
     */
    @Override
    public MyWorkshop selectMyWorkshopByWorkshopId(Long workshopId)
    {
        return myWorkshopMapper.selectMyWorkshopByWorkshopId(workshopId);
    }

    /**
     * 查询车间管理列表
     * 
     * @param myWorkshop 车间管理
     * @return 车间管理
     */
    @Override
    public List<MyWorkshop> selectMyWorkshopList(MyWorkshop myWorkshop)
    {
        return myWorkshopMapper.selectMyWorkshopList(myWorkshop);
    }

    /**
     * 新增车间管理
     * 
     * @param myWorkshop 车间管理
     * @return 结果
     */
    @Override
    public int insertMyWorkshop(MyWorkshop myWorkshop)
    {
        myWorkshop.setCreateTime(DateUtils.getNowDate());
        return myWorkshopMapper.insertMyWorkshop(myWorkshop);
    }

    /**
     * 修改车间管理
     * 
     * @param myWorkshop 车间管理
     * @return 结果
     */
    @Override
    public int updateMyWorkshop(MyWorkshop myWorkshop)
    {
        myWorkshop.setUpdateTime(DateUtils.getNowDate());
        return myWorkshopMapper.updateMyWorkshop(myWorkshop);
    }

    /**
     * 批量删除车间管理
     * 
     * @param workshopIds 需要删除的车间管理主键
     * @return 结果
     */
    @Override
    public int deleteMyWorkshopByWorkshopIds(Long[] workshopIds)
    {
        return myWorkshopMapper.deleteMyWorkshopByWorkshopIds(workshopIds);
    }

    /**
     * 删除车间管理信息
     * 
     * @param workshopId 车间管理主键
     * @return 结果
     */
    @Override
    public int deleteMyWorkshopByWorkshopId(Long workshopId)
    {
        return myWorkshopMapper.deleteMyWorkshopByWorkshopId(workshopId);
    }
}
